﻿<%@ Control Language="C#" AutoEventWireup="true" 
CodeBehind="ManagerSetDiscountPromotion.ascx.cs" 
Inherits="CS424_9pts.Manager.Modules.ManagerSetDiscountPromotion" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<div class="section-header">
    <div class="title">
        <img src="../Common/ico-sales.png" alt="Set Discount for Promotion" />    
    </div>
    <div class="options">
    </div>
</div>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>" 
    DeleteCommand="DELETE FROM [Promotion] WHERE [PromotionID] = @PromotionID" 
    InsertCommand="INSERT INTO [Promotion] ([Discount], [HasGift], [StartDate], [EndDate], [Status], [Num], [Name]) VALUES (@Discount, @HasGift, @StartDate, @EndDate, @Status, @Num, @Name)" 
    SelectCommand="SELECT * FROM [Promotion]" 
    UpdateCommand="UPDATE [Promotion] SET [Discount] = @Discount, [HasGift] = @HasGift, [StartDate] = @StartDate, [EndDate] = @EndDate, [Status] = @Status, [Num] = @Num, [Name] = @Name WHERE [PromotionID] = @PromotionID">
    <DeleteParameters>
        <asp:Parameter Name="PromotionID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Discount" Type="Double" />
        <asp:Parameter Name="HasGift" Type="Int32" />
        <asp:Parameter Name="StartDate" Type="DateTime" />
        <asp:Parameter Name="EndDate" Type="DateTime" />
        <asp:Parameter Name="Status" Type="Int32" />
        <asp:Parameter Name="Num" Type="Int32" />
        <asp:Parameter Name="Name" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Discount" Type="Double" />
        <asp:Parameter Name="HasGift" Type="Int32" />
        <asp:Parameter Name="StartDate" Type="DateTime" />
        <asp:Parameter Name="EndDate" Type="DateTime" />
        <asp:Parameter Name="Status" Type="Int32" />
        <asp:Parameter Name="Num" Type="Int32" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="PromotionID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" 
    AllowPaging="True" AutoGenerateRows="False" CellPadding="4" 
    DataKeyNames="PromotionID" DataSourceID="SqlDataSource1" ForeColor="#333333" 
    GridLines="None">
    <AlternatingRowStyle BackColor="White" />
    <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
    <EditRowStyle BackColor="#2461BF" />
    <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
    <Fields>
        <asp:BoundField DataField="PromotionID" HeaderText="PromotionID" 
            InsertVisible="False" ReadOnly="True" SortExpression="PromotionID" />
        <asp:BoundField DataField="Discount" HeaderText="Discount" 
            SortExpression="Discount" />
        <asp:BoundField DataField="HasGift" HeaderText="HasGift" 
            SortExpression="HasGift" />
        <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
            SortExpression="StartDate" />
        <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
            SortExpression="EndDate" />
        <asp:BoundField DataField="Status" HeaderText="Status" 
            SortExpression="Status" />
        <asp:BoundField DataField="Num" HeaderText="Num" SortExpression="Num" />
        <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
            ShowInsertButton="True" />
    </Fields>
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#EFF3FB" />
</asp:DetailsView>
